const {
    dbRebanner,dbPhone,dbComputer,dbReTabImg,
    dbSmartBanner, dbSmartTabimg, dbSmartNew, dbAppliances, dbEarphone, dbLight, dbBalanceCar, dbClean, dbFittingConsumable,
    dbTvdata,dbTvMore,
    dbHomeAppliancesMore,
    dbOneRank,dbGoods
} = require('../../model/Goods_Model/index')
// 推荐页轮播图
const Rebanner = async (req,res) => {
    // console.log(dbRebanner);
    let data = await dbRebanner()
    res.send({ 
        code: 200,
        data
    })
}
// 获取所有手机信息
const Phone = async (req, res) => {
    let data = await dbPhone(req.query)
    res.send({ 
        code: 200,
        data
    })
}
// 获取所有电脑信息
const Computer = async (req, res) => {
    let data = await dbComputer(req.query)
    res.send({ 
        code: 200,
        data
    })
}
// 推荐页的菜单栏图片
const ReTabImg = async (req, res) => {
    let data = await dbReTabImg()
    res.send({ 
        code: 200,
        data
    })
}
// 智能页
const SmartBanner = async (req, res) => {
    let data = await dbSmartBanner()
    res.send({ 
        code: 200,
        data
    })
}
const SmartTabimg = async (req, res) => {
    let data = await dbSmartTabimg()
    res.send({ 
        code: 200,
        data
    })
}
const SmartNew = async (req, res) => {
    let data = await dbSmartNew()
    res.send({ 
        code: 200,
        data
    })
}
const Appliances = async (req, res) => {
    let data = await dbAppliances(req.query)
    res.send({ 
        code: 200,
        data
    })
}
const Earphone = async (req, res) => {
    let data = await dbEarphone(req.query)
    res.send({ 
        code: 200,
        data
    })
}
const Light = async (req, res) => {
    let data = await dbLight(req.query)
    res.send({ 
        code: 200,
        data
    })
}
const BalanceCar = async (req, res) => {
    let data = await dbBalanceCar(req.query)
    res.send({ 
        code: 200,
        data
    })
}
const Clean = async (req, res) => {
    let data = await dbClean(req.query)
    res.send({ 
        code: 200,
        data
    })
}
const FittingConsumable = async (req, res) => {
    let data = await dbFittingConsumable(req.query)
    res.send({ 
        code: 200,
        data
    })
}
// TV页
const Tvdata = async (req, res) => {
    let data = await dbTvdata(req.query)
    res.send({ 
        code: 200,
        data
    })
}
const TvMore = async (req, res)=>{
    let data = await dbTvMore()
    res.send({
        code: 200,
        data
    })
}
// 家电页
// 更多好物
const HomeAppliancesMore = async (req, res)=>{
    let data = await dbHomeAppliancesMore();
    res.send({ 
        code: 200,
        data
    })
}
// 分类一级菜单
const OneRank = async (req, res) => {
    let data = await dbOneRank();
    res.send({ 
        code: 200,
        data
    })
}
// 分类内容
const Goods = async (req, res) => {
    let data = await dbGoods(req.query);
    res.send({
        code: 200,
        data
    })
}
module.exports = {
    Rebanner,Phone,Computer,ReTabImg,
    SmartBanner, SmartTabimg, SmartNew, Appliances, Earphone, Light, BalanceCar, Clean, FittingConsumable,
    Tvdata,TvMore,
    HomeAppliancesMore,
    OneRank,Goods
}